# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require(File.join(File.dirname(__FILE__), 'config', 'boot'))

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

require 'tasks/rails'

desc 'Task create for migrate to version 0 and HEAD the database and check all test. Use it before commit'
task :check => [:environment] do
  ActiveRecord::Migrator.migrate("db/migrate/", 0)
  Rake::Task["db:migrate"].invoke
  Rake::Task["test"].invoke
end
